import request from "@/utils/request.js"
import { useTokenStore } from "@/stores/token.js";
//笔记分类列表查询
export const articleCategoryListService = () => {
    // const tokenStore = useTokenStore();
    // //在pinia定义的响应式数据都不需要用value
    // return request.get("/category", { headers: { "Authorization": tokenStore.token } });
    return request.get("/category");
}
//没有删除的笔记分类列表查询
export const articleCategoryDeletedListService = () => {
    return request.get("/category/findByDeleted");
}
//笔记分类添加
export const articleCategoryAddService = (categoryData) => {
    return request.post("/category", categoryData);
}
//编辑笔记分类
export const articleCategoryUpdateService = (categoryData) => {
    return request.put("/category", categoryData);
}
//笔记分类删除
export const articleCategoryDeleteService = (id) => {
    return request.put("/category/delete?id=" + id)
}
//所有笔记列表查询
export const articleListService = (params) => {
    return request.get("/article", { params: params })
}
//笔记添加
export const articleAddService = (articleData) => {
    return request.post("/article", articleData)
}
//编辑笔记
export const articleUpdateService = (articleData) => {
    return request.put("/article", articleData);
}
//删除笔记
export const articleDeleteService = (id) => {
    return request.delete("/article?id=" + id);
}